<!-- device_detail -->
<!-- 用户中心=》用能单位=》项目详情 -->
@include("user.head")
<div class="wrapper">
	<div class="col-xs-12 no_padding_both">
		<ol class="breadcrumb">
	      <li><a href="<%url('')%>">碳银网首页</a></li>
	      <li><a href="<%url('industry')%>">低碳产业</a></li>
	      <li><a href="<%url('industry/device')%>">低碳设备</a></li>
	      <li class="active"><%$model["name"]%></li>
	    </ol>
	</div>
	<div class="row">
		<div class="col-xs-12">
			<div class="col-xs-6 no_padding">
				<img src="<%url('images')%>/<%$model["uid"]%>/device/<%$model["image"]%>" height="440" width="480" alt="">
			<!--<div class="col-xs-12 no_padding bianju">
				<div class="col-xs-3 no_padding"><img src="<%url('user/img/project.png')%>"height="80" width="100" alt=""></div>
				<div class="col-xs-3 no_padding"><img src="<%url('user/img/project.png')%>"height="80" width="100" alt=""></div>
				<div class="col-xs-3 no_padding"><img src="<%url('user/img/project.png')%>"height="80" width="100" alt=""></div>
			</div>-->
			</div>
			<div class="col-xs-6">
				<div class="col-xs-12 proritht">
					<%$model["name"]%>
				</div>
				<div class="col-xs-12 prorightRice bianju">
					<span class="prorightRice_size">
						￥<%$model["minimize_price"]%>元 - ￥<%$model["maximize_price"]%>元
					</span>
					<a href="javascript:;" class="fr" ralate='<%$model["id"]%>' id="collect"><i @if($isCollect)class="fa fa-star" @else class="fa fa-star-o" @endif id="collectIcon"></i>收藏</a>
				</div>
				<div class="col-xs-12 bianju proContent">
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">
							设备名称:
						</div>
						<div class="col-xs-9">
							<%$model["name"]%>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">
							设备应用领域:
						</div>
						<div class="col-xs-9">
							@if (isset($model["device_domain"]["domain"]["parent"]))
							<%$model["device_domain"]["domain"]["parent"]["cate_name"]%> <%$model["device_domain"]["domain"]["cate_name"]%>
							@else
							<%$model["device_domain"]["domain"]["cate_name"]%>
							@endif
						</div>
					</div>
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">
							发布机构:
						</div>
						<div class="col-xs-9">
							<%$model["userData"]["company_name"]%>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="col-xs-3 no_padding_right text-right">设备节能率:</div>
						<div class="col-xs-9">
							<%$model["efficiency"]%>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="row no_margin proDetail">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#jieshao" data-toggle="tab" aria-expanded="true">设备介绍</a></li>
			<li class=""><a href="#jingdu" data-toggle="tab" aria-expanded="false">设备规格</a></li>
			<li class=""><a href="#liebiao" data-toggle="tab" aria-expanded="false" class="deviceList">设备案例</a></li>
			<li class=""><a href="#project" data-toggle="tab" aria-expanded="false">应用项目</a></li>
		</ul>
		<div id="myTabContent" class="tab-content">
			<div class="tab-pane fade active in" id="jieshao">
			  	<div class="row">
			  		<div class="col-xs-4 proDetail_first">
			  			<div class="col-xs-12">设备名称:<%$model["name"]%></div>
			  			<div class="col-xs-12">认证信息:<%$model["auth_info"]%></div>
			  		</div>
			  		<div class="col-xs-4 proDetail_first">
			  			<div class="col-xs-12">设备型号:<%$model["model"]%></div>
			  			<div class="col-xs-12">
			  				领域:
							@if (isset($model["device_domain"]["domain"]["parent"]))
							<%$model["device_domain"]["domain"]["parent"]["cate_name"]%> <%$model["device_domain"]["domain"]["cate_name"]%>
							@else
							<%$model["device_domain"]["domain"]["cate_name"]%>
							@endif
			  			</div>
			  		</div>
			  		<div class="col-xs-4 proDetail_first">
			  			<div class="col-xs-12">生产商:<%$model["creator"]%></div>
			  			<div class="col-xs-12">设备价格:<%$model["minimize_price"]%>元 - <%$model["maximize_price"]%>元</div>
			  		</div>
			  	</div>
			  	<div class="col-xs-12 project_content" id="content">
		  		</div>
			</div>
		    <div class="tab-pane fade bianju upMar downMar" id="jingdu">
		    	@if (isset($model["device_features"]) && isset($model["device_functions"]))
					<div class="row deviceGui device_border no_margin">
						<div class="col-xs-12 deviceGui_zi">规格参数</div>
					</div>
					@if (isset($model["device_features"]))
					<div class="row device_border no_margin peculiarity" style="border-bottom:none">
						<div class="col-xs-12">设备特点</div>
					</div>
					<div class="row device_border no_margin peculiarity no_padding" style="border-bottom:none">
						@foreach ($model["device_features"] as $feature)
						<div class="col-xs-12 peculiarity_point">
							<div class="col-xs-2 text-right peculiarity_pointRi">
								<%$feature["name"]%>
							</div>
							<div class="col-xs-10">
								<%$feature["content"]%>
							</div>
						</div>
						@endforeach
					</div>
					@endif
					@if (isset($model["device_functions"]))
					<div class="row device_border no_margin peculiarity" style="border-bottom:none">
						<div class="col-xs-12">设备功能</div>
					</div>
					<div class="row device_border no_margin peculiarity no_padding" style="border-bottom:none">
						@foreach ($model["device_functions"] as $function)
						<div class="col-xs-12 peculiarity_point">
							<div class="col-xs-2 text-right peculiarity_pointRi">
								<%$function["name"]%>
							</div>
							<div class="col-xs-10">
								<%$function["content"]%>
							</div>
						</div>
						@endforeach
					</div>
					@endif
				@else
				无规格参数
				@endif
		    </div>
		    <div class="tab-pane fade bianju upMar downMar" id="liebiao">
		        @if (isset($model["device_cases"]))
				<div class="bs-example" data-example-id="panel-without-body-with-table">
				    <div class="panel panel-default">
				        <table class="table">
					        <thead>
					    	    <td class="col-xs-3 text-center"><b>案列名称</b></td>
					    	    <td class="col-xs-5 text-center"><b>案列内容</b></td>
					          	<td class="col-xs-2 text-center"><b>开始时间</b></td>
					          	<td class="col-xs-2 text-center"><b>结束时间</b></td>
					    	</thead>
					    	<tbody id="deviceList" class="text-center">
					    	</tbody>
					    </table>
				    </div>
				</div>
		        @else
					无设备案例
		        @endif
		 	</div>

		 	<div class="tab-pane fade bianju upMar downMar" id="project">
		        @if (isset($model["device_project"]))
				<div class="bs-example" data-example-id="panel-without-body-with-table">
				    <div class="panel panel-default">
				      <table class="table">
				        <tbody>
					        <tr class="techGood">
					            <th class="col-xs-3 text-center">项目名称</th>
					            <th class="col-xs-5 text-center">项目状态</th>
					            <th class="col-xs-2 text-center">项目计划启动时间</th>
					            <th class="col-xs-2 text-center">项目计划完成时间</th>
					        </tr>
					        @foreach ($model["device_project"] as $project)
							<tr>
					            <td>
					            	<a href="<%url('industry/project/detail?pid=')%><%$project['projects']['id']%>">
										<%$project["projects"]["name"]%>
					            	</a>
					            </td>
					            <td class="text-center">
					            	@if ($project["projects"]["is_financing"])
										@if ($project["projects"]["state"] == 0)
											<span class="label label-danger">正在招标中</span>
										@elseif($project["projects"]["state"] == 1)
											<span class="label label-warning">已确认执行方</span>
										@elseif($project["projects"]["state"] == 2)
											<span class="label label-success">正在进行中</span>
										@elseif($project["projects"]["state"] == 3)
											<span class="label label-primary">项目已完成</span>
										@endif
									@else
									项目未资产化
									@endif
					            </td>
					            <td class="text-center">
					            	<%noSecond($project["projects"]["start_time"])%>
					            </td>
					            <td class="text-center">
					            	<%noSecond($project["projects"]["end_time"])%>
					            </td>
					        </tr>
					        @endforeach
				        </tbody>
				      </table>
				    </div>
				</div>
		        @else
					无设备案例
		        @endif
		 	</div>
	 	</div>
	</div>
</div>
@include("user.footer")
@include("user.common")


<script type="text/html" id="deviceListTemp">
{%each list as value index}
<tr>
  <td>{%value.name}</td>
  <td>{%value.content}</td>
  <td>{%value.creat_time}</td>
  <td>{%value.end_time}</td>
</tr>
{%/each}
</script>




<script type="text/javascript">
var url = "<%url('user')%>/";
var did = "<%Input::get('did')%>";
$(".deviceList").click(function(){
	$.get("/tyw/public/industry/edit_device/get_case",  function (data){
		if(data.success){
			var html = template("deviceListTemp", {list : data.data});
			$("#deviceList").html(html);
		}
	})
})

$("#content").html(decodeURIComponent('<%$model["theory"]%>'));
// 添加收藏
$("#collect").bind('click', function(){
	_this = $(this);
	var relate_id = $(this).attr("ralate");
	$.post("<%url('collect/add_collect')%>", {
		type : 1,
		relate_id : relate_id
	}, function (data){
		if(data == 1){
			$("#collectIcon").attr("class", 'fa fa-star');
		}else if(data == 0){
			$("#collectIcon").attr("class", 'fa fa-star-o');
		}else{
			window.location.href = "<%url('login')%>";
		}
	})
})

</script>